# coding:utf-8
# name ：YuFuXiao
# date : 2018-9-XX

import threading
import time

#线程隔离
from werkzeug.local import Local

class A():
    b = 1

# obj_a = A()
obj_a = Local()
obj_a.b = 1
def worker():
    obj_a.b = 2
    print('新线程{}'.format(str(obj_a.b)))  #2

threading_a = threading.Thread(target=worker,name = 'qiyue_thread0')
threading_a.start()
time.sleep(1)
print('主线程{}'.format(str(obj_a.b)))  #1  这里没有使用线程隔离的时候是2
